﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Data;
using jsptpd.Pm.Interface.Oper;
using Jsptpd.Common.xmlUtil;


namespace Jsptpd.JobScheduler.pm
{
    class InterfaceInvoke
    {
        public void ReadDataFromPMRevoke()
        {
            #region Read data from PM
            DataOperation dataOperation = new DataOperation();
            string xml = dataOperation.ReadDataFromPM(false);
            XmlDocument xmlDocument = new XmlDocument();
            xmlDocument.LoadXml(xml);
            DataTable dt = XmlConverter.ReadDocumentToDataTable(xmlDocument.InnerXml);
            #endregion


            #region Update To local dataBase           
            UpdateDataToDB(dt);
            #endregion
        
        }

        private void UpdateDataToDB(DataTable dt)
        {
            DataOperation dataoper = new DataOperation();
            dataoper.UpdateTableToDB(dt);
        }

    }
}
